package com.yc.weixin.web.Handler;

import java.util.ArrayList;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.yc.weixin.entity.WeiXinTempPage;
import com.yc.weixin.entity.WeixinUserInfo;
import com.yc.weixin.service.WeixinUserInfoService;

/**
 * 微信用户基本信息处理类
 * @author shuang
 *
 */
@Controller
@RequestMapping("/weixinUserInfo")
public class WeixinUserHandler {
		
	@Resource(name="weixinUserInfoService")
	private WeixinUserInfoService weixinUserInfoService;
	
	@RequestMapping("/selectUserDataByPage")
	@ResponseBody
	public WeiXinTempPage<WeixinUserInfo>  selectUserDataByPage(int page,int rows){
		WeiXinTempPage<WeixinUserInfo> result=weixinUserInfoService.selectUserDataByPage((page-1)*rows,rows);
		if(result==null){
			result=new WeiXinTempPage<WeixinUserInfo>();
			result.setTotal(0);
			result.setRows(new ArrayList<WeixinUserInfo>());
		}
		return result;
		
	}
	
}
